package com.copsoftware.struts.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.copsoftware.mantenimientos.tipocalle.delegate.TipoCalleDelegate;
import com.copsoftware.procesos.denuncia.delegate.DenunciaDelegate;
import com.copsoftware.struts.forms.BaseActionForm;
import com.copsoftware.struts.forms.RegistrarDenunciaForm;
import com.copsoftware.utils.constants.CSConstants;

public class MostrarDenunciaAction extends BaseAction {

	@Override
	public ActionForward process(ActionMapping mapping,
			BaseActionForm baseForm, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		RegistrarDenunciaForm form = (RegistrarDenunciaForm) baseForm;

		DenunciaDelegate denunciaDelegate = new DenunciaDelegate();
		Integer cDenuncia = null;

		ActionForward nextPage = mapping
				.findForward("MOSTRAR_DENUNCIA_FORM_FWD");
		
		cDenuncia = form.getCDenuncia();
		if (form != null && cDenuncia!=null) {
			
			form = denunciaDelegate.getDenunciaForm(cDenuncia);
			request.setAttribute("RegistrarDenunciaForm", form);

		}
		else
			nextPage = mapping.findForward("REGISTRAR_DENUNCIA_FORM_FWD");

		return nextPage;
	}

}
